package com.travelDevelop.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface PermissionMapper {

	@Select("select count(DISTINCT a.operation_name) from group_operation a left join user_group b on a.group_id = b.group_id "
			+ "where b.user_id=#{userId} and a.operation_name in #{operationNames} ")
	int permissionsCount(@Param("userId") String userId, @Param("operationNames") String[] operationNames);
	
	@Select("select count(DISTINCT a.operation_name) from group_operation a left join user_group b on a.group_id = b.group_id "
			+ "where b.user_id=#{userId} and a.operation_name=#{operationName} ")
	int permissionCount(@Param("userId") String userId, @Param("operationName") String operationName);
}
